
<template>
  <div>
      登录中...
  </div>
</template>

<script>

  import { loginByTLToken } from '@/api/login/login';
  import { certifyLink } from "@/utils/config"
  export default {
    data() {
      return {
        certifyLink
      };
    },
    created() {
      let url = location.href; //获取url中"?"符后的字串
      if (url.indexOf("?") != -1) {
        let token = url.split("?")[1];
        this.$store.dispatch('LoginByTLToken',token).then((response) => {
          if(response.passwordNull){
            location.href = _const.HTTPLOCAT + '/authen.html#/tlagree';
          }else{
            location.href = _const.HTTPLOCAT + this.certifyLink[response.authStatus];
          }
        },(err) => {
          location.href =_const.HTTPLOCAT +'/';
        });
      }else{
        location.href =_const.HTTPLOCAT +'/';
      }
    }
  }
</script>

